package com.pkk.cloud.support.admin.mybatis.resource;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pkk.cloud.support.admin.dto.resp.urls.OauthUrlsAllRespDto;
import com.pkk.cloud.support.admin.entity.resource.PenguinSysUrl;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface PenguinSysUrlMapper extends BaseMapper<PenguinSysUrl> {

  /**
   * @Description: 保存接口信息
   * @Param: record
   * @return: int
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 5:09
   */
  int insertPenguinSysUrl(PenguinSysUrl record);

  PenguinSysUrl selectByPrimaryKey(Long id);

  int updateByPrimaryKeySelective(PenguinSysUrl record);

  /**
   * @Description: 获取资源信息依据用户id
   * @Param: userId
   * @return: java.util.List<com.pkk.cloud.support.admin.entity.PenguinSysUrlResource>
   * @Author: peikunkun
   * @Date: 2020/3/18 下午9:13
   */
  List<PenguinSysUrl> findPenguinUserUrlResourceByUserId(long userId);

  /**
   * @Description: 获取系统全部接口
   * @return: java.util.List<com.pkk.cloud.support.admin.dto.resp.urls.OauthUrlsAllReqDto>
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 下午 3:54
   */
  List<OauthUrlsAllRespDto> findSysUrlList();

  /**
   * @Description: 根据按钮id资源查询所拥有的接口信息
   * @Param: body
   * @return: java.util.List<com.pkk.cloud.support.admin.dto.resp.urls.OauthUrlsAllReqDto>
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 3:10
   */
  List<OauthUrlsAllRespDto> findUrlsByResourceId(Long resourceId);

  /**
   * @Description: 获取已绑定接口信息依据按钮和菜单信息
   * @Param: buttonId
   * @Param resourceId
   * @return: java.util.List<java.lang.Long>
   * @Author: peikunkun
   * @Date: 2020/4/22 0022 上午 10:34
   */
  Set<Long> getExistsUrlIdByResourceInfo(HashMap<String, Object> condition);

  /**
   * @Description: 获取客户端下面的所有接口
   * @Param: ownClientId
   * @return: java.util.Set<java.lang.String>
   * @Author: peikunkun
   * @Date: 2020/4/22 0022 上午 11:50
   */
  Set<String> findClientUrlsByClientId(Long ownClientId);
}